﻿@using Microsoft.AspNetCore.Http

@if (base.Context.Session != null && !string.IsNullOrEmpty(base.Context.Session.GetString("SESSION_HSP_CURRENT_USER")))
{
@*    string user = base.Context.Session.GetString("SESSION_ESP_CURRENT_USER");
    AuthUserDto currentUser = Newtonsoft.Json.JsonConvert.DeserializeObject<AuthUserDto>(user);
    using (Html.BeginForm("Logout", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" }))
    {
        @Html.AntiForgeryToken()

        <ul class="nav navbar-nav navbar-right">
            <li class="nav-item">
                @Html.ActionLink("你好" + currentUser.Name + "!", "ResetPassword", "Account", routeValues: null, htmlAttributes: new { title = currentUser.Name, @class = "nav-link text-dark" })
            </li>
            <li class="nav-item">
                <a class="nav-link text-dark" href="javascript:document.getElementById('logoutForm').submit()">注销</a>
            </li>
        </ul>
    }*@
}
else if (base.Context.User?.Identity?.IsAuthenticated ?? false)
{
    <ul class="nav navbar-nav navbar-right">
        <li class="nav-item">
            @Html.ActionLink("你好" + base.Context.User.Identity.Name + "!", "ResetPassword", "Account", routeValues: null, htmlAttributes: new { title = base.Context.User.Identity.Name, @class = "nav-link text-dark" })
        </li>
        <li class="nav-item">
        <a class="nav-link text-dark" href="~/Account/Logout">注销</a>
        </li>
    </ul>
}
else
{
    <ul class="nav navbar-nav navbar-right">
        <li class="nav-item">
            <a class="nav-link text-dark" href="~/Account/Login"> 登录 </a>
        </li>
    </ul>
}
